package com.hz.springboot01.controller;

import com.hz.springboot01.pojo.Provider;

import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/index")
public class IndexController {
    @Resource
    private Provider provider;
    @Resource
    private RedisTemplate redisTemplate;
    @GetMapping("/findProvider")
    public Provider findProvider(){
        return provider;
    }
    @GetMapping("/testString")
    public String testString(){
        redisTemplate.opsForValue().set("name","zhllalalal");
        Object name = redisTemplate.opsForValue().get("name");
        return (String) name;
    }


}
